package cn.wit.summit.chwan.widgets;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import cn.wit.summit.chwan.R;

/**
 * Created by yangg on 2018/4/27.
 */

public class RedEnvelopeDialog extends AlertDialog {

    ImageView iv_close, iv_show;

    public RedEnvelopeDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Window dialogWindow = getWindow();
        dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);
        dialogWindow.setGravity(Gravity.CENTER);
        setContentView(R.layout.redenverlope);
        iv_close = findViewById(R.id.iv_close_red);
        iv_show = findViewById(R.id.iv_show_red);
    }

    public void onClickClose(View.OnClickListener listener) {
        iv_close.setOnClickListener(listener);
    }

    public void onClickShow(View.OnClickListener listener) {
        iv_show.setOnClickListener(listener);
    }

}
